#!/usr/bin/env node

const program = require("commander");
const inquirer = require("inquirer");
const fish_dict = require('./index')
const debug = require('./lib/debug/debug')
const path = require('path')
const package = require('./package.json')

program.version(package.version);

  
program
    .command('make')
    .alias('m')
    .option('-f, --folder [dict_folder]', 'make dict')
    .action((args)=>{
        fish_dict.make_dict(args.folder || process.cwd())
    })
  
program
    .command('parse')
    .alias('p')
    .option('-f, --file <dict_file>', 'parse dict file')
    .option('-d, --dest <dict_parsed_folder>', 'destination folder')
    .action(async (args)=>{
        await fish_dict.parse_dict(args.file, args.dest)
    })

program
    .command('debug')
    .alias('d')
    .option('-f, --folder [src folder]', 'debug dict source')
    .action((args)=>{
        debug(args.folder || process.cwd())
    })

    
program.parse(process.argv)